package com.weiz.designpatterns.strategy;

import java.util.HashMap;
import java.util.Map;

public class DiscountStrategyFactory {
    private static final Map<String,DiscountStrategy> map = new HashMap<>();
    static {
        map.put("golden",new GoldenDiscountStrategy());
        map.put("silver",new SilverDiscountStrategy());
    }
    public static DiscountStrategy getDiscountStrategy(String type){
        return map.get(type);
    }
}
